#include <iostream>

#include "iostream"
#include "vector"
#include "unordered_map"
#include "unordered_set"
#include "algorithm"
#include "string"
#include "list"
#include "string.h"
struct Range{
    int left;
    int right;
};
bool cmp(Range& a,Range& b){
    return a.right<b.right;
}
class OneLoop {
public:
    std::vector<Range> ranges;
    bool check(int move){
        auto ranges_cpy=ranges;
        int left_=0;
        for(int i=0;i<ranges_cpy.size();i++){
            auto&range=ranges_cpy[i];
            if(range.left-left_>move){
                std::swap(ranges_cpy[i],ranges_cpy[i+1]);
                if(range.left-left_>move){
                    return false;
                }
//                return false;
            }
            if(range.left-left_>0){
                left_=range.right-(range.left-left_);
            }else{
                int move_= std::min(move,left_-range.left);
                left_=range.right+move_;
            }
        }
        if(left_>=20000){
            return true;
        }else{
            return false;
        }
    }
    bool run(int a) {
        for(int i=0;i<a;i++){
            Range r;std::cin>>r.left>>r.right;
            r.left*=2;r.right*=2;
            ranges.push_back(r);
        }
        std::sort(ranges.begin(),ranges.end(), cmp);
        int l=0,r=20000;
        int ans=0;
        while (l<=r){
            int mid=(l+r)/2;
            if(check(mid)){
                ans=mid;
                r=mid-1;
            }else{
                l=mid+1;
            }
        }
        if(abs(ans/2-ans/2.0)>0.00001){
            printf("%.1f\n",ans/2.0);
        }else{
            printf("%d\n",ans/2);
        }
        return true;
    }
};

class Solution {
public:
    void run() {

        bool first = true;
        int64_t a, b, c, d, e;
        char cc;
        //        std::cin >> a;
//        std::string s1,s2;
//        while (1){
        while (
                std::cin>>a
//                std::getline(std::cin,s1)
//                1
                ) {
//            std::getline(std::cin,s2);
            OneLoop l;
            if (!l.run(a)) {
//                return;
            }
        }


    }
};

int main() {

    //    bool cur_num= true;
    Solution().run();
    return 0;
}

